--- Makefile.orig	2005-12-05 00:33:57.000000000 +0100
+++ lrmi-0.10/Makefile	2008-07-14 15:16:41.206752922 +0200
@@ -1,7 +1,7 @@
-LIBDIR ?= /usr/local/lib
-INCDIR ?= /usr/local/include
+LIBDIR ?= /usr/lib
+INCDIR ?= /usr/include
 
-CFLAGS = -g -Wall
+CFLAGS += -g -Wall
 
 sources = lrmi.c
 objects = lrmi.o
@@ -30,17 +30,16 @@
 	ln -sf $(LIBNAME).so.$(VERSION) $(LIBNAME).so.$(MAJOR)
 	ln -sf $(LIBNAME).so.$(MAJOR) $(LIBNAME).so
 
-vbetest: vbetest.c liblrmi.a
+vbetest: vbetest.c liblrmi.so
 	$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $^
 
 install:
-	mkdir -p $(LIBDIR)
-	install -m 755 -s -p $(LIBNAME).so.$(VERSION) $(LIBDIR)/$(LIBNAME).so.$(VERSION)
-	rm -f $(LIBDIR)/$(LIBNAME).so
-	ln -sf $(LIBNAME).so.$(VERSION) $(LIBDIR)/$(LIBNAME).so.$(MAJOR)
-	ln -sf $(LIBNAME).so.$(MAJOR) $(LIBDIR)/$(LIBNAME).so
-	install -m 644 -s -p lrmi.h $(INCDIR)/lrmi.h
-	ldconfig
+	mkdir -p $(DESTDIR)$(LIBDIR) $(DESTDIR)$(INCDIR)
+	install -m 755 -s -p $(LIBNAME).so.$(VERSION) $(DESTDIR)$(LIBDIR)/$(LIBNAME).so.$(VERSION)
+	rm -f $(DESTDIR)$(LIBDIR)/$(LIBNAME).so
+	ln -sf $(LIBNAME).so.$(VERSION) $(DESTDIR)$(LIBDIR)/$(LIBNAME).so.$(MAJOR)
+	ln -sf $(LIBNAME).so.$(MAJOR) $(DESTDIR)$(LIBDIR)/$(LIBNAME).so
+	install -m 644 -p lrmi.h $(DESTDIR)$(INCDIR)/lrmi.h
 
 .PHONY: clean
 clean:
